<extend name="Public/base" />

<block name="body">
  <!-- 标题栏 -->
  <div class="main-title">
    <h2>会员等级管理</h2>
  </div>

  <div class="tools auth-botton">
    <a id="add-group" class="btn" href="{:U('add')}">新 增</a>
    <a url="{:U('setStatus', array('status' => 1))}" class="btn ajax-post" target-form="ids" >启 用</a>
    <a url="{:U('setStatus', array('status' => 0))}" class="btn ajax-post" target-form="ids" >禁 用</a>
    <button class="btn ajax-post confirm" target-form="ids" url="{:U('setStatus', array('status' => -1))}">删 除</button>
  </div>
  <!-- 数据列表 -->
  <div class="data-table table-striped">
    <table class="">
      <thead>
        <tr>
          <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
          <th>会员等级</th>
          <th>描述</th>
          <th>成员人数</th>
          <th>授权</th>
          <th>状态</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      <notempty name="lists">
        <volist name="lists" id="vo">
          <tr>
            <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
            <td><a href="{:U('edit?id='.$vo['id'])}">{$vo.title}</a> </td>
            <td><span>{:mb_strimwidth($vo['description'],0,60,"...","utf-8")}</span></td>
            <td>{$vo.id|getUserGroupCount}</td>
            <td>
              <a href="{:U('user?group_name='.$vo['title'].'&group_id='.$vo['id'])}" >成员授权</a>
            </td>
            <td>{$vo.status_text}</td>
            <td>
              <eq name="vo.status" value="1">
                <a href="{:U('setStatus?status=0&ids='.$vo['id'])}" class="ajax-get">[禁用]</a>
              <else/>
                <a href="{:U('setStatus?status=1&ids='.$vo['id'])}" class="ajax-get">[启用]</a>
              </eq>
              <a href="{:U('edit?id='.$vo['id'])}">[编辑]</a>
              <a href="{:U('setStatus?status=-1&ids='.$vo['id'])}" class="confirm ajax-get">[删除]</a>
          </td>
          </tr>
        </volist>
        <else/>
        <td colspan="7" class="text-center"> aOh! 暂时还没有内容! </td>
      </notempty>
      </tbody>
    </table>

  </div>
  <div class="page">
    {$_page}
  </div>
</block>

<block name="script">
  <script type="text/javascript" charset="utf-8">
    //导航高亮
    highlight_subnav('{:U('UserGroup/index')}');
  </script>
</block>
